<template>
  <div>
    <PageTitle :title="titleName"></PageTitle>
    <div class="form-wrapper">
      <el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="机器数量" prop="class_name">
          <el-input v-model="ruleForm.machineCount" :readonly="true"></el-input>
        </el-form-item>        
        <el-form-item label="订单数量" prop="class_name">
          <el-input v-model="ruleForm.orderCount" :readonly="true"></el-input>
        </el-form-item>
        <el-form-item label="退单数量" prop="class_name">
          <el-input v-model="ruleForm.backOrderCount" :readonly="true"></el-input>
        </el-form-item>
        <el-form-item label="订单金额" prop="class_name">
          <el-input v-model="ruleForm.orderPrice" :readonly="true">
            <template slot="append">元</template>
          </el-input>
        </el-form-item>
        <el-form-item label="商品库存" prop="class_name">
          <el-input v-model="ruleForm.Stock" :readonly="true"></el-input>
        </el-form-item>
      </el-form>
    </div>
    
    <div class="foot">
      <el-button type="primary" @click="$router.go(-1)">取消</el-button>
    </div>
  </div>
</template>

<script>
  import PageTitle from '@/components/pageTitle/PageTitle.vue'
  // import DetailTable from '@/components/detailTable/DetailTable.vue'
  export default {
    name: 'GoodsTypeAdd',
    components: {
      PageTitle,
      // DetailTable
    },
    mounted() {
      // this._get()
    },
    data() {
      return {
        detail: {}
      }
    },
    computed: {
      titleName() {
        return '用户详情'
      }
    },
    methods: {
      async _get() {
        try{
          let { data: {code, data } } = await this.$axios({
            url: this.$api + '/v1/fication/surface' ,
            method: 'GET',
            params: {
              id: this.$route.params.id
            }
          })
          
          if(code == 0) {
            this.ruleForm.class_name = data[0].class_name
            this.ruleForm.state = data[0].state
          } else {
            this.$message.warning(data.message)
          }
        }catch(e){
          this.$message({
            type: 'error',
            message: e
          })
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .table-wrapper {
    position: relative;
    margin: 30px 0;
    .title {
      // text-align: center;
      margin-bottom: 20px;
      padding: 0 20px;
    }
    .switch {
      position: absolute;
      top: 2px;
      left: 110px;
    }
    .inner {
      padding: 0 20px;
    }
  }
  .foot {
    padding-left: 20px;
  }
  
</style>
